﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using aier.dataaccess.dapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using aier.dataaccess.model;

namespace aier.dataaccess.dapper
{
    [TestClass()]
    public class AttachmentDalUT
    {
        private AttachmentDal attachmentDal = null;

        [TestInitialize]
        public void Init()
        {
            attachmentDal = new AttachmentDal();
            //attachmentDal.dapperHelper = new DapperHelper("Data Source=121.43.171.131;Initial Catalog=aier_mobile;Persist Security Info=True;User ID=hunkw;Password=123qwe,./");
        }


        [TestMethod()]
        public void SaveAttachmentUT()
        {
            AttachmentView attachmentView = new AttachmentView();
            attachmentView.ATTID = "ou123456";
            attachmentView.INTIME = DateTime.Parse("2019-06-01 05:58:00");
            attachmentView.MODTIME = DateTime.Parse("2019-07-01 05:58:00");
            attachmentDal.SaveAttachment(attachmentView);
        }

        [TestMethod()]
        public void ModAttStateUT()
        {
            attachmentDal.ModAttState("ou123456");
        }
    }
}